<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>楼栋添加页面</title>
    <link rel="stylesheet" type="text/css" href="../../static/admin/layui2/css/layui.css"/>
</head>
<body class="layui-layout-admin" >
<div class="layui-anim layui-anim-scale">
    <form class="layui-form layui-form-pane" name="form1" id="form1" style="margin-top: 20px;">
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">项目编码</label>
            <div class="layui-input-inline">
                <input type="text" name="xiangmubianma" id="xiangmubianma" class="layui-input" lay-verify="required" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">楼栋编码</label>
            <div class="layui-input-inline">
                <input type="text" name="loudongbianma" id="loudongbianma" class="layui-input" lay-verify="required" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">楼栋名称</label>
            <div class="layui-input-inline">
                <input type="text" name="loudong" id="loudong" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">使用状态</label>
            <div class="layui-input-block">
                <input type="radio" name="shiyongzhuangtai"  value="1" title="闲置">
                <input type="radio" name="shiyongzhuangtai"  value="2" title="使用">
                <input type="radio" name="shiyongzhuangtai"  value="3" title="住满">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">启用状态</label>
            <div class="layui-input-block">
                <input type="radio" name="qiyongzhuangtai" id="open" value="1" title="启用">
                <input type="radio" name="qiyongzhuangtai" id="close" value="0" title="禁 用">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">房产权利人</label>
            <div class="layui-input-inline">
                <input type="text" name="fangchangquanliren" id="fangchangquanliren" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">当前权利人</label>
            <div class="layui-input-inline">
                <input type="text" name="dangqianquanliren" id="dangqianquanliren" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">区域</label>
            <div class="layui-input-inline">
                <input type="text" name="quyu" id="quyu" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">固定资产卡号</label>
            <div class="layui-input-inline">
                <input type="text" name="gudingzichankahao" id="gudingzichankahao" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">房产地址</label>
            <div class="layui-input-inline">
                <input type="text" name="fangchandizhi" id="fangchandizhi" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">总建筑面积</label>
            <div class="layui-input-inline">
                <input type="text" name="zongjianzhumianji" id="zongjianzhumianji" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">使用面积</label>
            <div class="layui-input-inline">
                <input type="text" name="shiyongmianji" id="shiyongmianji" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">土地用途</label>
            <div class="layui-input-inline">
                <input type="text" name="tudiyontu" id="tudiyontu" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">开始使用日期</label>
            <div class="layui-input-inline">
                <input type="text" name="kaishishiyongriqi" id="kaishishiyongriqi" lay-verify="date" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">结束日期</label>
            <div class="layui-input-inline">
                <input type="text" name="jieshushiyongriqi" id="jieshushiyongriqi" lay-verify="date" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">竣工日期</label>
            <div class="layui-input-inline">
                <input type="text" name="jungongriqi" id="jungongriqi" lay-verify="date" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">购买或租入日期</label>
            <div class="layui-input-inline">
                <input type="text" name="goumaizururiqi" id="goumaizururiqi" lay-verify="date" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">购置方式</label>
            <div class="layui-input-inline">
                <input type="text" name="gouzhifangshi" id="gouzhifangshi" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">委托单位</label>
            <div class="layui-input-inline">
                <input type="text" name="weituodanwei" id="weituodanwei" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">总楼 层数</label>
            <div class="layui-input-inline">
                <input type="text" name="zonloucengshu" id="zonloucengshu" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">产权用途</label>
            <div class="layui-input-inline">
                <input type="text" name="chanquanyongtu" id="chanquanyongtu" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">使用年限</label>
            <div class="layui-input-inline">
                <input type="text" name="shiyongnianxian" id="shiyongnianxian" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">剩余年限</label>
            <div class="layui-input-inline">
                <input type="text" name="shengyunianxian" id="shengyunianxian" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">房产证编号</label>
            <div class="layui-input-inline">
                <input type="text" name="fangchanzhengbianhao" id="fangchanzhengbianhao" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">购买地点</label>
            <div class="layui-input-inline">
                <input type="text" name="goumaididian" id="goumaididian" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">购置金额</label>
            <div class="layui-input-inline">
                <input type="text" name="gouzhijine" id="gouzhijine" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 130px;">备注</label>
            <div class="layui-input-inline" style="width: 400px">
                <textarea placeholder="请输入内容" class="layui-textarea" name="beizhu" id="beizhu"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">修改</button>
            </div>
        </div>
    </form>
</div>
</div>
<script src="../../static/admin/layui2/layui.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['element','form','jquery','layer','laydate'], function() {
        var element = layui.element
        var form = layui.form
        layer = layui.layer
        $ = layui.jquery;
        laydate = layui.laydate
        laydate.render({
            elem: '#kaishishiyongriqi'
        });
        laydate.render({
            elem: '#jieshushiyongriqi'
        });
        laydate.render({
            elem: '#jungongriqi'
        });
        laydate.render({
            elem: '#goumaiZururiqi'
        });

        form.on('submit(demo1)',function(data){
            $.ajax({
                type:"POST",
                url:"/loudong/update",
                data:{
                    "xiangmubianma": data.field.xiangmubianma,
                    "loudongbianma":data.field.loudongbianma,
                    "loudong": data.field.loudong,
                    "shiyongzhuangtai":data.field.shiyongzhuangtai,
                    "qiyongzhuangtai": data.field.qiyongzhuangtai,
                    "fanchangquanliren":data.field.fangchangquanliren,
                    "dangqianquanliren":data.field.dangqianquanliren,
                    "quyu":data.field.quyu,
                    "gudingzichankahao":data.field.gudingzichankahao,
                    "fangchandizhi":data.field.fangchandizhi,
                    "zongjianzhumianji":data.field.zongjianzhumianji,
                    "shiyongmianji":data.field.shiyongmianji,
                    "tudiyontu":data.field.tudiyontu,
                    "kaishishiyongriqi":data.field.kaishishiyongriqi,
                    "jieshushiyongriqi":data.field.jieshushiyongriqi,
                    "jungongriqi":data.field.jungongriqi,
                    "goumaizururiqi":data.field.goumaizururiqi,
                    "gouzhifangshi":data.field.gouzhifangshi,
                    "weituodanwei":data.field.weituodanwei,
                    "zonloucengshu":data.field.zonloucengshu,
                    "chanquanyongtu":data.field.chanquanyongtu,
                    "shiyongnianxian":data.field.shiyongnianxian,
                    "shengyunianxian":data.field.shengyunianxian,
                    "fangchanzhengbianhao":data.field.fangchanzhengbianhao,
                    "goumaididian":data.field.goumaididian,
                    "gouzhijine":data.field.gouzhijine,
                    "beizhu":data.field.beizhu,
                },
                dataType:"json",
                success:function (res) {
                    if (res.flag) {
                        layer.msg('修改成功！',{icon:6,offset:"auto",time:2000});//提示框,提示2秒自动消失
                    }else  {
                        layer.msg('修改失败！',{icon:5,offset:"auto",time:2000});//提示框
                    }
                    setTimeout(function(){
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);//关闭弹出层
                        parent.location.reload();//重新加载父页面表格
                    }, 2100);
                }
            })
            return false;
        });
    });
</script>
</body>
</html>